<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // var a=80;
        // var res=5/9.0*(a-32);
        // var result=parseInt(res*1000)/1000;
        // console.log(result);
        // parseInt取整
        var tem = prompt("请输入华氏摄氏度");
        var res = 5/9.0*(tem-32);
        // 先乘以1000 取整  除以1000
        console.log();
        var reslut = parseInt(res*1000)/1000;
        console.log("摄氏度是:"+reslut+"℃");
    </script>
</body>
</html>